package tests;

import java.util.LinkedList;

import retrievedatafromrevishapi.GetReviewDataFromApi;

import bookworm.Review;

public class GetReviewFromXMLTest 
{
	public static void main(String args[])
	{
		GetReviewDataFromApi getReview = new GetReviewDataFromApi();
		LinkedList<String> arguments = new LinkedList<String>();
		arguments.add("title");
		LinkedList<String> argumentsValues = new LinkedList<String>();
		argumentsValues.add("twilight");
		
		LinkedList<Review> reviews = getReview.getBookReviewsFromRevishAPI(arguments, argumentsValues);
		for(int i = 0; i < reviews.size(); i++)
		{
			Review review = reviews.get(i);
			System.out.println("////////////////// NEW REVIEW /////////////////");
			System.out.println("ID: " + review.getReviewId());
			System.out.println("ISBN: " + review.getIsbn());
			System.out.println("Book title: " + review.getBookTitle());
			LinkedList<String> authors = review.getAuthors();
			System.out.println("///AUTHORS///");
			for(int j = 0; j < authors.size(); j++)
			{
				 System.out.println("author: " + authors.get(j));
			}
			System.out.println("Reviewer: " + review.getReviewer());
			System.out.println("Review title: " + review.getReviewTitle());
			System.out.println("Publisher: " + review.getPublisher());
			System.out.println("Review date: " + review.getReviewDate());
			System.out.println("Rating: " + review.getRating());
			System.out.println("URL from review: " + review.getUrlReview());
			System.out.println("Small cover: " + review.getSmallCover());
			System.out.println("Medium cover: " + review.getMediumCover());
			System.out.println("//////Links to shops where you can buy the book///////");
			LinkedList<String> links = review.getLinksWhereToBuyBook();
			for(int k = 0; k < links.size(); k++)
			{
				System.out.println("link: " + links.get(k));
			}
			
			System.out.println("Review text: is in the text area");
			
			System.out.println("////////////////// END OF NEW REVIEW /////////////////");
		}
	}
}
